Added fix, workaround handlebars issue and added tests
Use regexp instead of isNaN for detecting integers.
Move tests from handlebars to templating, as they depend on templates. Also, extend to test a few more types.
Review from Geoff
Merge branch 'pr-651' into devel