Fixed download URL in public page
Fixed JS issues in public page

- fixed subdir detection when uploading into subdir
- add class detection before overriding to avoid JS errors
Fixed issues with renaming

- summary is now untouched on rename instead of bogus incrementation
- fixes "Share" status icon by only triggring "fileActionsReady" once
- row is now reinserted even when rename is cancelled, this removes the
  hacky/buggy code that tried to rename the element back
- added unit tests to cover the fixed cases
flock changes.  Work in progress.