Port to index.js to CoffeeScript
Remove path.exists and existsSync backwards compatibility

path.exists and path.existsSync were moved to fs.exists and
fs.existsSync in node v0.8. Since package.json requires node version
>= 0.8.16, it is safe to remove the backwards compatibility checks
and rely solely on fs.exists and fs.existsSync.
Convert getpin to switch statements
Unnest some if-else statements