fixed rotate opcodes, added unit tests