Move parser logic from parser.module to parser.inc