Added basic thread-safety to MatrixController.
Moved modes into subdirectory in controller directory.