Move factories under lib to require them in applications.