Refactor(main): Rewrite all code
Refactor(main): Rewrite all code

* Replaced http bits with httpreq package

* Split code into functions

* More useful error callback

* JSdoc functions
fvdm/nodejs-openkvk