Re-written using as much C as possible.

Included build instructions.