Move parser up in the file. Also make it parse nested subexpressions properly