(PUP-2693) Fix length calculation for sq-string

The calculation of string length was done wrong for dingle
quoted string resulting in negative lengths.
(PUP-2807) Add output of containing scope for log functions

The log functions in 3x outputs th name of the containing scope
(for notice etc.). The reimplemented methods for the 4x function API
did not include this behavior.

Now, the calling scope is passed to the Logging utility to be output
the same way as for 3x.
(PUP-2883) Allow empty body in epp templates

This allows an epp body to be empty by making grammar accept an
empty list of statements. This avoids getting a cryptic error message
about "syntax error at end of file" when using parameters, but having no
body that produces output, or when having a completely empty template.
(PUP-2873) Reasonable default logdests for master

Commit a1dba44 removed a potentially duplicate log destination when
using `puppet master --compile`, but it also meant that `puppet master
--compile` would default to logging to syslog. This issue revealed other
issues, where running `puppet master --no-daemonize` would log to
syslog, but `puppet master --no-daemonize --verbose` would log to the
console. Inconsistencies like these could lead to very surprising
behavior for users.

This commit refactors the master logging to default to console when the
master is running in the foreground and to syslog when running in the
background. When a log destination is given with '--logdest' the default
log destination is ignored in preference of the explicit log
destination.
Merge pull request #2856 from adrienthebo/fix/master/pup-2873-better-master-logging

(GH-2873) Reasonable default logdests for master
Merge pull request #2792 from hlindberg/PUP-2807_log-containing-scope-name

(PUP-2807) Add output of containing scope for log functions
Merge pull request #2868 from hlindberg/PUP-2883_empty-epp-template

(PUP-2883) Allow empty body in epp templates
Merge pull request #2755 from hlindberg/PUP-2693_length-of-sqstring-wrong

(PUP-2693) Fix length calculation for sq-string
(maint) Fix typo in comment
(PUP-2714) Support explicit creation of empty program

An empty program (one without any expressions except "no-op") did
not produce an instance of Model::Program. This is bad because it
is of value to get the lexed/parsed model with line references for
comment processing and other static analysis of the source.

Now, an empty program will produce a Model::Program containing a single
Model::Nop instruction. This instruction has offset at "EOF", and a
length of 0 (thus, any comments in the input source are guaranteed to be
placed before this nop.
(PUP-2757) Change Puppet::Resource default env to avoid duplicate parsing.

When a Resource is used as a reference, it still needs to find its type
and will try to find it via known_resource_types in the environment.
Hence, if Puppet::Resource#environment produces the special environment
NONE when the resource is not contained in a catalog (as no references
by definition are) then, the NONE environment will need to be populated
and this triggers a duplicate initial_import).

This commit changes the default environment for a resource to be:

* the environment attribute if set
* the current_environment if set
* the special environment NONE if the other two were not set