Retreiving tokens reworked to promises instead of synchronous ajax with jquery

Signed-off-by: Jakub Koudelka <koudelka.j@gmail.com>
Init automatic token refresh after page reload

Signed-off-by: Jakub Koudelka <koudelka.j@gmail.com>