Put unicode functions in unicode.c, and tidy their names.
diff --git a/py/lexer.c b/py/lexer.c
index 6e43c74..4df91b0 100644
--- a/py/lexer.c
+++ b/py/lexer.c
@@ -54,9 +54,9 @@
         const char *j = i + tok->len;
         printf(" ");
         while (i < j) {
-            unichar c = g_utf8_get_char(i);
-            i = g_utf8_next_char(i);
-            if (g_unichar_isprint(c)) {
+            unichar c = utf8_get_char(i);
+            i = utf8_next_char(i);
+            if (unichar_isprint(c)) {
                 printf("%c", c);
             } else {
                 printf("?");
@@ -116,19 +116,19 @@
 }
 
 static bool is_whitespace(mp_lexer_t *lex) {
-    return g_unichar_isspace(lex->chr0);
+    return unichar_isspace(lex->chr0);
 }
 
 static bool is_letter(mp_lexer_t *lex) {
-    return g_unichar_isalpha(lex->chr0);
+    return unichar_isalpha(lex->chr0);
 }
 
 static bool is_digit(mp_lexer_t *lex) {
-    return g_unichar_isdigit(lex->chr0);
+    return unichar_isdigit(lex->chr0);
 }
 
 static bool is_following_digit(mp_lexer_t *lex) {
-    return g_unichar_isdigit(lex->chr1);
+    return unichar_isdigit(lex->chr1);
 }
 
 // TODO UNICODE include unicode characters in definition of identifiers
diff --git a/py/misc.h b/py/misc.h
index 1a33f05..9f83ab5 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -37,24 +37,13 @@
 
 typedef int unichar; // TODO
 
-unichar g_utf8_get_char(const char *s);
-char *g_utf8_next_char(const char *s);
+unichar utf8_get_char(const char *s);
+char *utf8_next_char(const char *s);
 
-bool g_unichar_isspace(unichar c);
-bool g_unichar_isalpha(unichar c);
-bool g_unichar_isprint(unichar c);
-bool g_unichar_isdigit(unichar c);
-
-//char *g_strdup(const char *s);
-
-/** blob ********************************************************/
-
-/*
-unsigned short decode_le16(byte *buf);
-unsigned int decode_le32(byte *buf);
-void encode_le16(byte *buf, unsigned short i);
-void encode_le32(byte *buf, unsigned int i);
-*/
+bool unichar_isspace(unichar c);
+bool unichar_isalpha(unichar c);
+bool unichar_isprint(unichar c);
+bool unichar_isdigit(unichar c);
 
 /** string ******************************************************/
 
diff --git a/py/parse.c b/py/parse.c
index ad9a47f..d3786ba 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -212,7 +212,7 @@
             }
         }
         for (; i < len; i++) {
-            if (g_unichar_isdigit(str[i]) && str[i] - '0' < base) {
+            if (unichar_isdigit(str[i]) && str[i] - '0' < base) {
                 int_val = base * int_val + str[i] - '0';
             } else if (base == 16 && 'a' <= str[i] && str[i] <= 'f') {
                 int_val = base * int_val + str[i] - 'a' + 10;
diff --git a/py/repl.c b/py/repl.c
index ecf6e2d..4241ef0 100644
--- a/py/repl.c
+++ b/py/repl.c
@@ -8,7 +8,7 @@
             return false;
         }
     }
-    return head[i] == '\0' && (str[i] == '\0' || !g_unichar_isalpha(str[i]));
+    return head[i] == '\0' && (str[i] == '\0' || !unichar_isalpha(str[i]));
 }
 
 bool mp_repl_is_compound_stmt(const char *line) {
diff --git a/py/runtime.c b/py/runtime.c
index 1598cc2..748294c 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -226,7 +226,7 @@
     unique_codes[unique_code_id].is_generator = false;
     unique_codes[unique_code_id].u_native.fun = fun;
 
-    printf("native code: %d bytes\n", len);
+    //printf("native code: %d bytes\n", len);
 
 #ifdef DEBUG_PRINT
     DEBUG_printf("assign native code: id=%d fun=%p len=%u n_args=%d\n", unique_code_id, fun, len, n_args);
@@ -421,8 +421,7 @@
     DEBUG_OP_printf("load_build_class\n");
     mp_map_elem_t *elem = mp_qstr_map_lookup(&map_builtins, rt_q___build_class__, false);
     if (elem == NULL) {
-        printf("name doesn't exist: __build_class__\n");
-        assert(0);
+        nlr_jump(mp_obj_new_exception_msg(rt_q_NameError, "name '__build_class__' is not defined"));
     }
     return elem->value;
 }
@@ -525,7 +524,7 @@
                 break;
             }
 
-            default: printf("%d\n", op); assert(0);
+            default: assert(0);
         }
         if (fit_small_int(lhs_val)) {
             return MP_OBJ_NEW_SMALL_INT(lhs_val);
@@ -831,8 +830,7 @@
     } else if (MP_OBJ_IS_TYPE(base, &instance_type)) {
         mp_obj_instance_store_attr(base, attr, value);
     } else {
-        printf("?AttributeError: '%s' object has no attribute '%s'\n", mp_obj_get_type_str(base), qstr_str(attr));
-        assert(0);
+        nlr_jump(mp_obj_new_exception_msg_2_args(rt_q_AttributeError, "'%s' object has no attribute '%s'", mp_obj_get_type_str(base), qstr_str(attr)));
     }
 }
 
diff --git a/py/misc.c b/py/unicode.c
similarity index 85%
rename from py/misc.c
rename to py/unicode.c
index a5bf8d5..58c860a 100644
--- a/py/misc.c
+++ b/py/unicode.c
@@ -1,5 +1,4 @@
 #include <stdint.h>
-#include <string.h>
 
 #include "misc.h"
 
@@ -39,27 +38,27 @@
     AT_LO, AT_LO, AT_LO, AT_PR, AT_PR, AT_PR, AT_PR, 0
 };
 
-unichar g_utf8_get_char(const char *s) {
+unichar utf8_get_char(const char *s) {
     return *s;
 }
 
-char *g_utf8_next_char(const char *s) {
+char *utf8_next_char(const char *s) {
     return (char*)(s + 1);
 }
 
-bool g_unichar_isspace(unichar c) {
+bool unichar_isspace(unichar c) {
     return c < 128 && (attr[c] & FL_SPACE) != 0;
 }
 
-bool g_unichar_isalpha(unichar c) {
+bool unichar_isalpha(unichar c) {
     return c < 128 && (attr[c] & FL_ALPHA) != 0;
 }
 
-bool g_unichar_isprint(unichar c) {
+bool unichar_isprint(unichar c) {
     return c < 128 && (attr[c] & FL_PRINT) != 0;
 }
 
-bool g_unichar_isdigit(unichar c) {
+bool unichar_isdigit(unichar c) {
     return c < 128 && (attr[c] & FL_DIGIT) != 0;
 }
 
@@ -76,9 +75,3 @@
     return c < 128 && (attr[c] & FL_LOWER) != 0;
 }
 */
-
-/*
-char *g_strdup(const char *s) {
-    return strdup(s);
-}
-*/