semi-automated library function loading, some fixes, some updates