Fixed package json so npm install works
Modularized and shortened code, Implemented winston logger