introduce first-order support for resource directories (introduced in IDEA 13)

@Deravel please review