Fixed bug that occurred when listName is undefined
Fixed bug that occurred when a path has spaces
Moved function definitions away from initialization code
Added message support for delete document