Updated architecture and inline documentation.