Converts to not-nullable boolean
static bool toBoolean(dynamic d, bool def) { return toBooleanN(d) ?? def; }