require() replacement for a test environment that allows easy spying