Import globals as G + related cleanups.