Fixed secure_random_source
Added io_*_varint functions and improved memory_output_reset