Support GET /{index}/_mapping and more tests

Complete the support of the _mapping endpoint.
Add more tests for event-style and callback-style.