[ndproj] Adds a class that serializes queries.

This class takes a query (from the rules.xml file) and makes it
into a valid .ndproj <Query> node that will be inserted in the
.ndproj.

Change-Id: I9b8cf1dca921cb0a0ecc4663fd482b0c224283b9