Remove warnings from R CMD check

- changes in `.onLoad`
- add tweaks for empty directories

The same as #317, but applied to the `dev` branch. If you merge both, `master` and `dev` are still in sync.

Fixes #316 (=includes it).