Fix up some more datatypes stuff.

- Add unit test to check the to_op() output.
- Fix the to_op() return values for flags and registers
- Prune adds from the Map.to_op() output if the field is updated.