Shrink runtime optimizer & fix parameter reading

* This removes the class RuntimeOptimizer, a simple function is
  sufficient.
* Parameters are read with the appropriate bitwidth.