Move some functions to the library.
Update the version.