Delete unused stuff.
RSRC -> RDEF and some other fixes.
More cleanup.
Bugfix from Paradoxianer.
Use the be_roster instead of system() calls.

Also remove some duplicate code.