factor out platform specific code

subdirectory for every recognized platform (for now: posix and win32)