Cleanups and updates to support django 1.7.