Replaced boost::array by std::array. Removed a lot asserts
Swapped x and z to make x the lowest dimension