Move decoders code.
Improved connection combinations.

Provides a dictionary mapping connection to index into the connection list.
Connection replacing method.

Adds method to replace connections whose objects have been replaced.