mergeOptions support for commands
* Refactored modals * Added unit tests for modals * fixes unknown modal dismissing and added tests