Made this self-sufficent (except for <sys/types.h>) when compiled in user mode.
Made this self-sufficent (except for <sys/types.h>) when compiled in
user mode.

Improved formatting and comments (mostly punctuation in comments).

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase