[api] initial refactoring of request history handling

This should be generic enough to log also readable histories
for other objects like projects and packages.
[api] add setpriority command for requests