Add implementations of naive and memoizing, with benchmarks