Representing content_model and content_format as integers in the database was suggested by Asher mainly to save space. This change entails some refactoring and renaming, but no big change in logic.