ENH: Better tests

Ready for review/merge.

Closes #179.
More of a question than a comment: for defining a one-liner like this inside of another function, is it better to use `def` or to use `lambda`? Or does it not matter?