Added support for different output types and a crude HTML form.