Weighted elementwise sum layer

This PR adds a layer that computes a weighted sum of its input layers. This can often serve as an alternative to concatenating layers.
The PR is on top of #61 -- if you merge that first, everything is fine, otherwise I can modify this PR to remove the first commit.