Started refactoring things into a new Kernel class.

- Moved some of the parts of the Thread class that are more general
  into a new Kernel class. This is still a work in progress.
- Reverted to using Thread::s_currentThread instead of g_ar_currentThread
  since no assembler code is accessing it.
- Removed pending_service_call() function from ar_port.h.
- Fixed up some documentation comments.
- Using accessor methods to get the current thread or current ticks in
  some cases.
- Updated basic_test.cpp.
Extracted other classes from ar_thread.cpp.

- Moved NamedObject and Kernel classes to their own source files.
- Added ThreadWithStack template class.
- Updated test code to use ThreadWithStack.
Changed cleanup methods to destructors.

- Converted all the kernel object cleanup() methods to destructors.
- Removed the commented out code to switch to PSP from Kernel::initSystem().
- Renamed g_muAllObjects to g_allObjects.