A general implementation of a cellular automata engine