Upgraded PE getData function to use JSON parsing

Upgraded PE getData function to use JSON parsing where data- includes JSON and a fallback where malformed (for backwards compatibility with metadata.js). Also updated working examples to use JSON strings.