Split cli from core

I've split it into two files by separating the cli from the core. This allows you to use ```npm-latest``` as a local or  global ```node module``` depend on your needs.