Make API work when used as a gem

A couple of issues that came up when I used this as a gem in another project. These are just some proposed fixes-- in particular the relative path doesn't seem to work with the validator as it uses the containing project as the base path instead of the gem itself.