The Diversion 1.74 recovery project is, excluding the server code, completely open source!
You can fork it, make changes and just look around the code!