Refine Error types

Use built-in TypeError instead of plain Error.
Add type checking for fileStore.store options

I also refactored store to be more asynchronous.