Various bugfixes and moving code around
Added a basic front-end to the parser