Renamed/moved self memoizing functions
Merge branch 'chapter4'
Merge branch 'master' into chapter2