Restructured library API to be more organic.