Allow writing to $basedir.
Merge pull request #1 from tomstockton/master

Allow writing to $basedir.