Fix video_offset generation

Before this patch, the value for this was written to output as a raw
byte, not as its string representation.
Don't generate key=value lines without values.

BlitzLoop's fine with a missing video, but it can't handle a
specification of the format 'video=', so don't generate this kind of
line in the output at all.
Properly handle UltraStar's ~ metacharacter

The tilde is UltraStar's non-breaking space character, and is used to
specify different pitches for parts of the same syllable. Since we don't
have any use for it and don't want it to show up in BlitzLoop files, we
mask it and let the duration of these pseudo-syllables get carried over
to the next real syllable.
move debug output into a function for readability
refine and abstract tilde handling

Tildes (or any character you want) are now filtered out by the lexer if they are specified in the third command line argument.