Clean up indexing.
Comment out inactive flag
Port lots of model code to logic layer.