WELP. Here's the vanillajs submission

Lotta code. Seems to all work. I very well could have missed some things in the spec, but I think I got everything. Let me know!