Refactored Kernel to shared library