add package.json for npm
refactor lib/night_server.js