Simplify code that decides if input is JSON-LD or a filename/URL

Instead of searching for occurrences of "{" and "[" in the whole string, only check the first character.

Also eliminated unnecessary temporary variable. Re-use parameter variable instead.