Make package work as library as well as from command line.