Initial implementation

... unsurprisingly it doesn't fully work yet. :P