Refactored HTTP server into separate class.