Cleanups + moved filtering code to dico.
Added master-details capability.