move main file to lib
add index file
update links to lib files
change index.js to executable
rename a native function name
put commands in a command handler