Rework init.d script

Still runs everything as root, but it's a lot
cleaner than before.