quaternion: clean up with better macros

Improve the macros for accessing the input quaternion parameters, and
create a similar macro for accessing the output quaternion.
quaternion: implement rotation in assembly

This code is difficult to read (and write!) because of how much I have to
move registers around.  It may be possible to improve the register
allocation and make this easier to read, and possibly faster.