completly new class

New class now checks for erros and stores them in the database, now
stores tokens etc in database. tokens can now be renewed automatically.

much more.