update spec test, refactored lib, added gitignore file