Use viewport width for metrics calculations

This means that I can adjust the size of the viewport on the fly and the
metrics will all work.
Add means to select a level size