fix memory leak issues

This PR addresses a memory leak issue within the module, this issue is much more apparent with larger files (such as allCountries.zip)

In the process of fixing this I also wrote my own streaming tsv parser, so that is also included in this PR.