Fix bunch of potential NPEs. Added some comments. Fixed typos. Remove duplicated if statement. 

Now that the library can be started without an Activity/Context, care has to be taken so it doesn't attempt to use a null context. Also fixed a bunch of NPEs. ;)