fixed example, updated package.json, small changes to lib, general code cleanup