Now properly extracts the URL and prefix fragments to handle an arbitrary or empty prefix, using a simple regex. Closes #522