Implement readDir in REST back-end

Refactor request code for readDir, getMtime and pathExists into
_readPath and _readPathSync private functions.

Plus the usual selection of typo fixes.