Refactored original put functionality in local storage for better directory and exception handling.

Along with some testing for that.