Fixes to the controllers in NuGet and Sample.

Code cleanup, additional documentation, throw an exception on null
externalIdentity.
IE11 compatibility fixes

- Fixes for how javascript is handled in an href.
- Fixes for lack of window.location.origin support.
Merge pull request #2 from advancedrei/master

Fixes to improve readability, exception handling, and IE11 support.