Added consumer metrics and built in health checks. Also some general refactoring.