implement STEX mode (closes #8) and refactor some instructions