updated latest v for npm
modularized all main files into lib
moved source files to lib
updated for new lib structure