Add size function and tweak build for native
autofix: cache per-switch compilation results

At the moment, trying to compile a switch policy when a switch connects
to the controller will lead to connection time-outs. To avoid this in
the short term, katnetic will now compile all switch policies and cache
them before the controller starts.