Import fixes
Lots of parser and test refactoring