added preliminary parser header

based on main.cpp
added processing for varlist dump
added variable dumping

also closed files that were left open