reject invalid opts flags more strictly
replace handrolled binary copy with call to binary:copy
factor out clean_string to jsx_utils