Replace assert statements with exceptions
Created by: aroffringa
The code currently has many "assert(..)" statements, that in most cases seem to catch user errors (e.g. things like a missing parmkey value). assert statements should only be used for catching code bugs by the developer, since asserts are not enabled in a release build. When user errors happen, an exception should directly be thrown instead.