Added upload cancellation for a better UX.
Cleaned up coding style for JS.
Added table sorting for narratives and updated cursor type.