Made table renaming more safe and compatible.
Moved PublishedManager into django_libs.