making compatible with hapi 4.x and adding integration tests