Ensure indexing by feature id is consistent throughout.

Changed the window lookup to used the dictionary based feature ids, and 
pulled out a bit of code to test and re-use for creating the feature id lookup.


This comment has been dropped - not sure if you want to bring it back (I don't mind)