Updated to restify v2. Refactored non REST API functions into functions.js. Added tests for functions.js. Improved test-api.js to work with existing db records.