Add more test cases

Especially to cover operations on directories and tests that should throw errors.

Not ready yet.