Add simple send function
properly pack messages

also reduce optimization while testing.

also various other small fixes.