Doctype

I have added the doctype tests that @joaomilho asked for. Sorry for waiting, i was quite busy. I've also fixed the two old failing tests. This should complete #11