Changes to attribute parsing and the way normal tokens are written
Add tests for beforeTokenWrite hook