refactor module view templates to reduce duplication

@dannyroberts 

QA ticket: http://manage.dimagi.com/default.asp?122993