core: add framework for internal tests
core: convert arithmetic operations on field to arith instruction