Add fix for IE removal of leading slash in restrictOrigin
Refactor restrictOrigin to be cleaner
Fix small tab/white space issue