Fixing minor logic issues, adding spec tests, updating README with testing