Add swagger ui

@stuartf : I've refined the implementation for this a bit. Can you merge my `swagger` branch into this?