Add better token management, drop dependency on dead restler project