refactoring stuff 1

@wasamasa can you have a look here? the macro testing macro seems to have a bug when you don't specify a docstring. I fought long and hard with trying to get the test to work (which it does now). maybe you can spot the problem with the macro?

I'd probably like to add some more cleanups...