Tests and basic functionality

It's good practice to put your JS inside an IIFE (https://github.com/johnpapa/angularjs-styleguide#iife) to keep things from leaking into global scope that don't need to be there.