bug fixes, additional tests and addition of a destructive tail reversal operation