Github Post-receive hooke controller: move to module

Move the payload extraction / validation logic to a module so the
main body of the code is more clear.
CLI: working commandline

With a few tests. '--help' is very minimal.

Removed unused mkdirp and added 'optimist' for cli option parsing.
exists() check new location first

So we don't get a deprecation warning.
Merge cli (#3) into master

CLI: working commandline

With a few tests. '--help' is very minimal.

Removed unused mkdirp and added 'optimist' for cli option parsing.