Re-roll of PR#40 to remove unrelated changes

Original is here: https://github.com/phase2/oa_core/pull/40

I haven't actually tested it, just re-rolled it.