Expose modal template to facilitate testing
Add unit tests