Added a small dialog api.
No testing so it may be full of bugs...