Moved things into lib and refactored a few interfaces.

Signed-off-by: King Lemming <kinglemming@gmail.com>
Slot Refactors. :)

Signed-off-by: King Lemming <kinglemming@gmail.com>