Move program logic to lib/ package.