Add: kernel/daoPlatforms.h and kernel/daoPlatforms.c;
Move: most platform specific codes (except for threading) to the new source files;
Fix: a couple of minor memory leaking bugs.