Added some extra debugging.

Signed-off-by: Michel <info@1st-setup.nl>
Cleaned up functions of adding and updating offline cache.
Removed some old code.
Set status to first sync done earlier when possible.

Signed-off-by: Michel <info@1st-setup.nl>
Removed unused functions

Signed-off-by: Michel <info@1st-setup.nl>
Changed writing to offline cache from synchronious to asynchronious.

Signed-off-by: Michel <info@1st-setup.nl>