Parser

Reorganizing functions into a class. Adding doc strings.