Consolidate into lib directory; add gitignore

I've shuffled the web and API into `lib/` and cleaned up the
require statements.

This commit also adds a `.gitignore` for Ruby-related things, to
hopefully keep things tidy going forward.