Added option to build nested result sets. Added flatnest dependency.