Fix write_string to use memory buffer.
Configurable build name.
Remove duplicate code in add_byte_to_buffer.