Added ctx function, show index in error output.
Added putCtx func, some refactorings.
Added modify function. Added Error type.