Support scaler plugins.

This adds support for switching scaling factor and scaler plugin for
video output. In software rendering mode, the scaler is used for the
whole screen output on every frame. On HW mode, the scaler is only run
for every sprite when it is loaded to video memory. The code is not yet
quite done, and still needs some sanity checks and cleanups. It is, however,
good enough to go live. At the moment this code has been tested with the
xBRZ scaler plugin.