core: replace directory() helper with bulk() helper which has a lot more potential.