Added hash function.

Also moved POSIX feature flag to source files.