solves #67: massive refactor to use ES6 modules under the hood