Initial hacking and documenting; doesn't actually work at all yet.