try/catch when using mustache to catch delimiter errors.

fixe bug in patient reports where db was undefined. added module level
db.