New matrix code.

Remove IoPort and Key class and inline functionality in matrix.cpp.
The new implementation makes heavy use of macros to unroll loops.

Debounce now is based on a method by Soarer from GH.
Optimize port reading code.
Fix ASSERT macro.

ASSERT should only be enabled in debug build.