Added a bunch of functionality. The mechanics will be done sooon, and I can start polishing it up.

Signed-off-by: firebellys <firebelly@gmail.com>