Insert basic code.

I've essentially just dragged and dropped the code from the main SWDF
project into here. I'll be adding examples and tidying up the code in a
future commit.