refactor module view templates to reduce duplication

@dannyroberts 

QA ticket: http://manage.dimagi.com/default.asp?122993
Well its better in terms of less code and more configurable. Agree about the anit-pattern though except that the full identifier is never referenced directly so you'd always have to search using the suffix.

Open to suggestions on how to do it without this.