Tweak routing, memoization and some tests