Refactoring, logging, httpd, etc

General spring cleaning. Still ongoing, but grab this for now