First attempt

PR'ing this so you can track it.

Should work, needs testing + compiling.