Significant re-writes. Kinda MVC-style now.