turn directories filter into inner class, add tests for tricky resource path loading