Upkeep of objects, starting flatdoc

Removing UI index (to be made automatic in template), changing
this.getTemplate to getTemplate, reorganizing.