Expand ~ character in paths

This should resolve #9. This does not rely on the shell to expand paths,
only on POSIX commands.
Merge pull request #17 from MichaelXavier/expand-paths

Expand ~ character in paths