Filter tests

* Started filter package tests: wrote test for png output filter.
* Minor bugfix in the generic decoder.