Major design refactoring to match specs from Simon (#29)