Add options to toggle memoization and debug mode