Remove comments, and fix sorting of imported schemas