Added comments and a file exists check.
Tests and misc changes.
- switched to environment variable support instead of abs paths since
  this is much easier to realise multi platform
- added tests
- added validation