Start of implementation of userspace threading API.
Program entry points are not C entry points. Stop pretending that they are.
Fixed bugs in userspace threading functions.