Weights finalizers

This improves Luke's pull request by moving all initialization and finalization code to the right method. It also makes parameter averaging idempotent when it comes to setitng things to/from averages.