Made Mock a global function to work better with modules