First working prototype.

Lots of stuff is still hardcoded, and I'm aware of non-optimal
decisions which do reduce the level of security I'm eventually
going for. Do NOT use this for anything.