refactoring ... clean up macroparser... add some tests. broken