(maint) Optimize adding tags

Resources add a lot of tags and so streamlining that ends up with a
overall savings for catalog compilation. This removes an extra call to
collect, removes several method calls, and relies on the fact that the
@tags object is a set and so we don't need to check for the tag already
being there.
(maint) Use JSON for parsing metadata.json

Now that puppet depends on JSON we can use it to parse the metadata.json
file. The built in json parsers will be much faster than PSON.
(maint) Remove String check

There isn't any need to check for the String class because it also
responds to to_str. This reduces the number of calls in the case of
things that respond to to_str
(maint) Reduce calls to settings

During the lifetime of a scope object the value of the trusted data
settings should not change. Rather than looking this up on every
invocation of setvar, which is fairly expensive, the scope can simply
hold onto the value from when it was instantiated.
(maint) Hold token name in local variabel

The tokens name was fetch multiple times in quick succession. The lexer
is in a very tight inner loop and so any reduction of method calls can
produce improvements in performance. Although most work for language
performance is focussed on the new parser, this is a simple, small win
that we can easily take now.