Fixed parsing the tokens so it actually worked. Only headers are
currently implemented, but header nodes are now properly parsed and
everything else is properly ignored.
- Get the input filename from the command line
- Added in a bunch of checks to avoid segfaults
- Added some more debug info in places