Minor cleanup

Took a couple of utility functions from the Parser module back up to
Main. Simplified the file handler function