Basic code

The fundamental logic without any testing, UI, or platform-specific
code.