Exactly what I was looking for without even knowing it :)
EDIT: well I knew I need smt like this, but I thought I'd had to build a very rudimentary version myself. Thank you for saving me tons of time in my project
I'm very close to releasing an alpha, will post here when ready!