Refactor and update tests

Lots of refactoring, updates the tests to run again (still fails 2 tests), and adds support to pass the options hash through in post requests.
Could we rename this `ORIGIN`? "Origin" has a well-defined meaning; "base URL" does not.