Added defaultVariables option and tests for it

Implementation of global variable replace #307
Oh yes, thank you.