RFCT Replace C-style arrays by std::vector

These have the advantage of being checked in debug mode.

Additionally, this simplified some of the accesses which used to take
two array lookups and now take a single one. This could have been done
using C-arrays, of course.