Began major code updates

Code is in the middle of major changes. Wanted to commit it so I would
have a copy to fall back on if something went wrong.