Code cleanup. Docs. Tests.