Reorganised the matrix definitions to make it easier to read and to
refer to specific keys.  Added matrix hacks.