Backport of d0653c9 LP: #1870171 - Remove the token column from the Node table.
The token column is only used by the API when allocating and machine and
listing allocated machines. When a User Token is deleted this association
causes the Node to be deleted as well. Allocated machines are already
filtered by owner and status so the token column isn't needed.
In the backport Node.token is no longer used but the column remains to
avoid creating a migration.
LP: #1759091 - Limit the amount of queries used during a list operation.
Handlers can now specify a list_queryset which is used when the client calls
list(). The machine, device, and controller handlers have been updated to
only output data needed for the listing page for that node type. All node
types now have their query count tested for list and get.
Only cache processed ScriptResults for the current nodes being dehydrated.
Previously MAAS would cache the current ScriptResults for all nodes
to minimize database lookups. This caused all ScriptResults to be
loaded into RAM regardless of how many nodes are actually being
loaded. Now only the latest ScriptResults from the current set of
nodes being dehydrates are loaded. As nodes are dehydrated their
ScriptResults are cleared from cache to reduce memory usage on the
region.