Add nested and/or filtering

Once again I succumb to the siren song of Scala's constructors as types. Happy to add another top-level constructor if you prefer.