refactor unit tests so they work in RubyMine

- explicitly add the test and lib directory to the load path
- switch to the project root before running tests
- add UTF-8 encoding magic header to all test files
- exclude .gem file at root of project (where RubyMine puts it)

This commit was modified from the original pull request by @mojavelinux