Started refactoring

Everything in limbo right now. Started major refactoring to make things
more simple and straightforward. Just syncing.