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
Merge pull request #1129 from hwhw/master

Fixes for Refresh+Viewport, cleanup of MD5 functions