Pulled in refactoring bits of rapidsms_edtrac view_helper utils