[api] move duplicated rating function to a shared mixin

I can't find code atm to update the rating - at some point it seems to
have vanished
[api] move common code of project and package to HasAttributes