Some cleanups done in my spare time

Here's some cleanup work done in my own time to make SambaDAV more of a modern PHP application.