Uses of env var to pass configuration file path (required for tests)
Improve data types, add funcionts
Clear main, add tests