restructure templates to use json for use with phonegap