Allow specifying flat notes and use correct unicode symbols instead of '#'

Lots of other small tidying etc