Massive fix and cleanup, much shinier now.