Here a proposal of mine that i wrote after looking a bit in the code. http://projects.blender.org/developer/diary.php?diary_id=230&diary_user=26292 If i should write it somewhere else where everybody can modify it, let me know and i'll do it. Any help, suggestion or correction will be much appreciated :)