A JavaScript implementation of Fibonacci with some caching