I've decided to give this a complete re-write. There's some good code here but it's pretty broken in terms of functionality.

I will be writing...