Contenttypes more configurable

This finishes off the first part of the work. Adds options to the field interface to define how values are stored in the database.