Added background processing and javascript polling (broken atm)