Move double functionality in a single function

Compression and expansion is build up in 3 parts: a) Process single index symbols until cbn becomes zero; b) Do block processing by reading (or writing) 8 index symbols a time (thus saving cbn calculations); and c) process the lasts index symbols.

Well a) and c) have the same processing and for compression and expansion that functionality is moved to a single function.