Added lots of things for POSIX compliance. Also added Makefile.