Fix nokogiri

Nokogiri 1.4.6 contains a critical XXE security vulnerability. See https://github.com/sparklemotion/nokogiri/issues/693.

This PR bumps Nokogiri to the latest version (1.6.1) and fixes a broken test, which resulted from incorrect usage of the Nokogiri API.

Thanks to @cjoudrey for the actual regression fix.

Please review @voxxit @csaunders / cc @jstorimer