Added reduce and primitive wrappers to library