Take SN's codebase and modify where needed. I feel like it's quite close with what it already supports.