Use internal array-append in ast.casting
Switch to a slightly simpler memocache model