Support for client downloads from server UI.
More compile fixes.
Client was relying on 'principal' in session rather than 'currentPrincipal'
Merge branch 'develop' into ticket_327