Filled out the body of keysched.

Finishing main and debugging are all that's left for the code.