cleanups in vest.conf
better json tests for /vest.json
Refactoring.

Moved JavaScript code to vest.js and made it private.