Strip out brace comments before parsing, some refactoring