make functions in MD5 implementation local

also get rid of mostly unused helper libraries and some stylistic
oddities in the MD5 code
calculate proper refresh coordinates when using viewport

The viewport offset used by refresh() was not properly adapted when
the screen was rotated.
add test for md5 implementation