Fixed maths::Vector coordinate functions

Now return a reference to a temporary variable that is set to 0 on each
coordinate function call. This is a hack for now to avoid undefined
behaviour.
Expanded test program