Added support for AngularJS and bare-Browser

I needed this to work in the browser. It was an easy fix.
Re-formatting was done as well.