Added renaming functionality to to_dict().

Sometimes it is useful to have database data dictionaries named differently that what they are named in the database, e.g. making database data compatible with an existing RESTful JSON API.