Transferred the ownership of the weight array.

Does not work for the counterprop_test. Need a test persistence file.
Got the testPersistance file working to fix old tests.
Made more compile warnings visible.

Fixed most of the warnings that appeared.
Got rid of all gcc warnings.