check if jwt is valid in isAuthenticated
getPayload checks if it's valid token, returns undefined if not.

Fixes #162
added implicit grant flow
renamed saveToken to setToken
pass querystring directly from pollPopup

Fixes #159
getToken test
getPayload test
test for setToken throw error