Read/parse files up front

and cleanup reading/parsing files in general
Merge pull request #501 from presidentbeef/parse_files_upfront_instead_of_on_demand

Read/parse files up front