Fix escapes
Fix chord formatting
Add format option
Make define parsing more robust