* refactor tests to be more extensible
* Move elements-related code to separate file
* Copy over tests for element chain
* Handle `undefined` match group
As this test from python indicates, the right-most match group may be
empty. In javascript the behavior for this is different from python and
the match group may be `undefined`
* Update import
* Fix http capabilities