Knowledge Refactoring for Inductive Program Synthesis