Dimensionality checks

Added dimensionality checking for connections.
- added explicit checks with helpful error messages for connections
  with mismatched dimensionality
- Nodes now have separate size_in and size_out parameters