WIP: refactor structure and code for use with Batman or Ember.