Here are a bunch of conceptually separate patches. They are unlikely to work entirely separately in practice due to external things like IMP.{ih} and SConscript files and test cases tying them together.
The first cleans up the BondedListScoreState by deleted some commented out code adding a comment and adding a set_particles method to go along with the corresponding method in nonbonded list.
The next updates the nonbonded list in two ways. First it is refactored so that the internals can be reused by other states (namely a BipartiteNonbondedListState I use) and secondly the distance threshold belongs in the iterator, not in the constructor as different restraints may have different thresholds. It is not currently used as the internal implementation is dumb, but we should try to converge on the desired interface anyway.
Corresponding changes are made to the NonbondedRestraint
I added a preliminary implementation of a BondedList which uses the bond decorator definition of a bond. It comes with a restraint which uses length and spring constant info stored in the bond particle to restrain the bond. We probably want to revisit what is stored in the bond (in light of the discussions concerning the Harmonic).
Finally, the aforementioned bipartite nonbondedlist. It only returns pairs which cross two sets of particles. It seemed worth having such a class as it can be implemented much more efficiently than just having filters on top of the regular nonbonded list. And it is little code until then.