Moved operating systems code to its own source/header file.