Port some of lib.base to new library spec