Add more speed tests and fix speedbugs.

Costs for set/get parameters are a bit higher because the parameters are
distributed over memory but forward/backpropagation is faster.