Use Hash#fetch to provide a cache

Take advantage of the behavior of `Array#fetch`.
http://www.ruby-doc.org/core-2.1.1/Array.html#method-i-fetch

If the key does not already exist, `fetch` will execute the block given.
In that block we can then set the key so that subsequent calls to fetch
will return the pre calculated value.