Move style parser code to parser.js