Port flatten over to skbio

This implementation of flatten is much cleaner and faster than other of
the available alternatives.