Some work on retrieving all the model parameters (#142). Also some minor cleaning up.