Changes:
* as much as possible is controlled by global parameters,
* variables have more consistent names,
* the functions are more consistently structured,
* stem ends are placed in one line using explicit beam direction.
The glyphs remain identical.
It would be good to extract one global procedure that would draw
all needed sharps (instead of having 6 similar ones), but i didn't
have enough time to do this.