(maint) Match current spec style and usage
(PUP-1372) Add variable and pops type checks to defined function

The original Puppet::Parser::Functions defined() checked whether a class
or resource type had been defined, or a particular resource reference
declared.  We've extended this to allow for checking variable
assignment, by looking up a string reference for the variable name.

This version can also look up defined classes, types and resources by
type reference if the future parser is in effect.

Paired with Henrik Lindberg <henrik.lindberg@puppetlabs.com>
Merge pull request #2411 from jpartlow/feature/master/pup-1372-enhance-defined-function

Feature/master/pup 1372 enhance defined function