Changed the way require works to improve caching.