move main code to lib, rename to a name not taken on npm, make requireable with a passed config