Fixed some error in plugin/service removal

Removing a plugin did not remove its services. Now fixed. Then I have improved SQL queries on plugins database. Github here shows that I have modified a hundred of lines, but that's not really true... I have just  removed a 4 spaces-indentation in 70 lines of code