Add unit tests for ArrayRef
This fixes mdrun signalling on BG/Q. The templated constructor for
ArrayRef does not work with xlc 12 on BG/Q with array fields of
structs unless the base type has size equal to char. Presumably this
is another example of the way that attributes of struct fields just
get thrown away by compilers.
Changed name of local variable to sig, just in case "signal" clashes
with a preprocessor symbol somewhere...
Some changes to the arrayref.h implementation to make it easier to
write the tests as type-parameterized, by making the factory functions
also appear as members of the corresponding classes, with the same
name for both ArrayRef and ConstArrayRef. While there, remove some
documentation duplication.
Fixes #1701
Change-Id: I6894706b224dc5f3db7893503371107f1ff324d2