Updated memo impl to not use trampoline but store values with callbacks.