kind of a port of python -m SimpleHTTPServer