Make it work at all with input files (oops) and improve token-parsing