Fixed learning bug, added gate template and more

- weight matrix on learned connections wasn't being multiplied by dt,
  now it is
- also fixed bug of not being able to connect two populations of
  different sizes with learned connection
- added ability to specify function on connect_neurons call if you
  are doing a vector-neuron connection
- added a gate template
- a bit of other cleaning up