Move some macros to sx

This is some refactoring to facilitate voting and commenting.
It's written on top of #90 , so the diffs will get a lot shorter once that is merged.