Removed all hacky OS specific code

This is massively better than the hacks we had before.