Added nodeJS support and refactored project for nodeJS use