Remove unchecked ID manipulation calls.
Rewrite nextjob() to correctly check error conditions.
Fix various compiler warnings.
Update packaging.

Modernised and greatly simplified.
Fix up various lintian complaints, override a warning.