Framework for avoiding global pollution of class and module methods when stubbing