Use shared_ptr for storing neuron weights.

Decreases memory usage when learning is done on multiple tracks.
Otherwise performance is not impacted.

Fixes #71.