index_by and refactor

Added an :index_by param that returns a hash rather than an array,
and refactored a lot of code.
Use symbols as hash keys where possible.
Updating.
cleaner default parameter management
cleaner default parameter management
Use Time objects instead of strings where necessary