Significant reorganization of URLs.py. Also implements 301 redirection of old URLs to map to new URL schemes.