Remove totally_ordered helper class.

MSVC has a known bug which prevents empty base class optimization in some
cases. See
http://stackoverflow.com/questions/12701469/why-empty-base-class-optimization-is-not-working
for details. With this change we introduce some code duplication, but avoid
triggering this bug.

This should help with #35.