Parser refactor 3

Refactor to parser is done. There is still much on the to do list in the future, but we are ready for the first review.