- copied memoize function from underscore.js into lego-gears.js so I
  could analyze the memoization.

- simplified the hashing a bit.