Revised client-side unit testing to use phantomjs; added API support for domains; Refactoring

- Refactored multiple items to simplify the code (interfaces were removed along with some redundancies).
- Implemented mocha-phantomjs and added to travis to satisfy #9; this now runs both node and client side unit tests.
- Added #12 to support domains "local", "remote" and "localAndRemote"; default is "local". Only the router is required to specify this.
- Revised necessary documentation.