Main code is now a library.