Added print_chords_to_string function

This function returns the chords printed as a string instead of writing to stdout.