This is a work in progress, some bits work correctly, some not. Will add a README.md once it is usable.