refactor exercise into base template + exercise pages
DRY javascript for exercises