Fix posix compilation, split off traits part & tests