Move tests to elasticsearch test framework

Related to #49.
(cherry picked from commit a85c3be)