Cleanup and documentation of modules lib