Fix up reset session, move rawcode out of parser, into context