Semi-working implementation of function thunks.