Simple utility for serializing page DOM to JSON