Abstract DOM

Fix for #52