GH-172 - SetDtd on XmlDocument

This should allow a user to set the doctype on a document. Internally
uses the createIntSubset function and applies the dtd to the document
passed into the function.

There were some issues relating to removal of the dtd by calling
xmlCreateIntSubset so instead we first have to get the dtd node, and
then basically remove it and free it before we can apply the new dtd.
This might be better as a few split api's rather than just one lump api
but I figured it would be a little easier this way.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Added cstring include.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Styling and error handling.

I fixed some stylistic things relating to single line if statements.

I moved some of the checks to the JS side of the house. Because we need
to pass NULL to xmlCreateIntSubset for the last two params for them to
be ignored, we have to do some checks in the C++ side. In order to deal
with this I used strdup to grab the content of the v8::String.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Remove strdup.

No need for explicit use of strdup + free, the refs will be cleaned up
with the handles.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Cleaned up tabs and spacing for stylistic reasons.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Merge branch 'GH-172'
Always clean before running the tests...guarantees the latest will be tested.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
Merge branch 'master' of github.com:polotek/libxmljs