Improved the testing capabilities.

Added end to end tests using CasperJS.
Mocked node.js module dependencies using Mockery