couchapp: honour .json extension when loading directories