Added code(n)

Plus tests, and some new control(n) commands and tests.