divide libgloss into seperate files and add a lot of POSIX stub functions