Restructuring

Sorting out the client side code
Started adding background tasks