[#4242] Fixed recursion due to parents including their children
Resources mark themselves as evaluated to prevent being evaluated
again. Unfortunately, they were not marking themselves until after
they had finished being completely evaluated. Thus, there was
nothing actually stopping recursive evaluations. This patch just
makes resources mark themselves as evaluated when they start
evaluating, and adds tests.
The original setting of evaluated was done in an ensure block, so
this doesn't change the behavior of a resource which fails to
evaluate. The only places evaluated? is checked aren't affected
by this change, as they wouldn't want to evaluate it when it's
already being evaluated anyway.