Some Cross Platform Cleanup

better cross platform working with typedefs
Add basis for file system threading

created the functions
now we just need to impliment this on every file system function