remove unused imports
add missing serialVersionUID
replace deprecated methods
remove some unnecessary code
Merge pull request #397 from darkv/cleanup_patch

Some code cleanup