Hapi v2 rebased

Fixes #495.