massive refactoring; adding refresh token method; new database scheme and parsing