Removed redundant code

This is a general cleanup to remove functions & classes that weren’t
used any more. The codebase of the main file has been reduced by 1000
lines or so :-)