Added cache of globals (closed #62)