Made the whole script more general purpose

Can now be used with pretty much all addons that would benefit from such
a script