Move library code from src to lib.