Add local directory support

Please let me know if this messes anything up.