More 3.1 Compatiability Issues

Fixes issues with allowed actions and file overwrites on upload. Also now you can upload AND sort. The javascript changes seems a little hacky but it functions.