Refactor sso login code for rest API parsing.
Refactored sso logout url.

The sso logout url is now in a separate function.
This way a rest api can serve the url.
Fix bug in logout view.

Get the 'next' url before the session is flushed.
slightly improved function naming of get_sso_request; include LoginApiView / LogoutApiView which were originally in ddsc_site
Merge pull request #1 from lizardsystem/ddsc-api-dev

Refactored code for a rest api interface.