Refactoring

Refactored based on Stack Exchange Code Review feedback. Much cleanup.
Templates must be re-written for date variable change from 'date_text'
to 'date_txt'.