Refactor inflector
Extract query compiler into its own class