extract function library and merge types with AST, also begin work on function registry