Cache attributes for composer table

Currently, the composer attribute table is very heavy with the cpu, as it refetches the attributes from the layer's provider with every paint. This is both expensive and potentially results in many duplicated calls to a database backend. This pull request implements an attribute cache for the table, so that the attributes are only refetched when required. End result is that using composer tables no longer results in heavy cpu use and continual provider queries.

I'm reluctant to merge this myself as I don't know the history behind the composer table, and why it was originally created to requery on every paint operation. Perhaps there's a valid reason for this which I may be missing?