Removed old devsubsys syscalls from kernel.c
Refactoring thread management library functions