Add fully-functioning flatten() and some tests