Add tests for Element#map and Element#flatMap