Implement assert_nD in filter and feature packages

Builds on #1159.
int or iterable of ints, I would say