Cleanup and documentation. TODO: Add more events