Refactored servers for code sharing

Added base Server and ServerHandler classes to eliminate the many lines
of shared code between the media and web servers, and even within each
of those classes. Moved to regex url matching.