Implement lfs.normalize, lfs.dirname, and lfs.rmkdir; fix lfs.exists on windows

It turns out that windows is full of spiders: stat() will fail if the path has
a trailing directory, unless it's a root directory path, in which case it will
fail if it *doesn't* have one. lfs.exists now contains an ugly workaround for
this.

lfs.dirname() works as expected, except that \ may be translated to / in the
return value on windows.

lfs.rmkdir() replicates the behaviour of 'mkdir -p', i.e. it creates missing
intermediate directories and does not fail if the target already exists.
Move LFS functions into lfs.lua
Move the windows stat() workaround into lfs.attributes