Rudimentary changes to support django 1.5

Mostly fixes for the Django 1.5 `url` function.