Added Thread to keep HTML clients alive and refactored some code.