Match JSON even when Piwik does not send an array

Added regexps to match both [ and {. 
Also removed a duplicate trim().
Merge pull request #1 from engelfrost/patch-1

Match JSON even when Piwik does not send an array