Refactor how apps are represented internally in Django

This is not ready to be merged yet, just serving as a place to view/discuss everything.