Minor code cleanups, primarily using std::array where appropriate.
Use constexpr for constants where possible, since it's the C++11 thing to do.