introduce beginning of atomizer API and cleanup code
serious refactoring. server no longer relies on client code.