Enable usage by passing a DOM element and create tests for constructor

Closes gh-8.