Have added jasmine globals for jshint to remove the warnings and errors.
Formatted the main js alongwith with some very minor changes in the code
Added specs for toType and facebook method