services/tmserver: Replace optparse by argparse
tools/pocount: Replaces optparse by argparse
tools/pocount: Avoid a naked except clause
tools/build_tmdb: Switch to argparse
detectencoding: Get rid of old, unused script