Const and non-const arrfuncs

This PR implements the basic machinery for inplace ckernels and arrfuncs.