Added `flatten` and `flatten_once` filters

These filters flatten arrays. The first one does so recursively, the second one doesn't.