fixed imports and modularized draw_matrix js