Added command line support, ready for npm

Added command line support, ready for npm