NTFY-88 Try to parse the origin using the splitUrl function

Try to xtract the pieces of the URL with an already included library
rather than doing it by hand.
NTFY-88 Change the way getOrigin is invoked

The getOrigin function now throws an exception to return parsing errors
rather than using a callback.