Browser fixes and Karma test runner

> Note: this is based on https://github.com/strongloop/loopback/pull/172

Broke out the browser only changes into a separate PR.

/to @bajtos 
/cc @raymondfeng