Initial working version.

Does nothing yet, but at least compiles on all the platforms.