POC helper for wrapping global state

This commit adds a GlobalStateWrapper class that wraps global variables
with values specified in the constructor that will be used to create a
context within which a supplied anonymous function can be called. The
state before the function call will be restored after the call
completes. Exceptions are also captured and can be extracted from the
object if the caller so desires.
Stylize
Re-throw the exception instead of capturing it.

This will force the issue instead of potentially masking it.

/cc @pchojnacki
Merge pull request #4345 from Wikia/wrap-globals

POC Wrap global state: Not because you want to, but because sometimes you have to