Add an element_type field to topic elements

The number of SQL queries needed to determine the subclass types of
just a few of BaseTopicElements was alarmingly high using the method
previously employed in basetopicelement_fieldset.html. This commit adds
an 'element type' field to all topic elements, trading a bit of wasted
space (not much) for better performance.