Updated for https://www.drupal.org/node/2310411.

It appears this two can't be in main submit. It is also nicer if we separate diff buttons into diff functions. 

Not sure what to do with errors handling, though (redundant code in both funcitons). submitForm() is not even called if validation fails so it can't be in there. Not sure if there is any suggested pattern how to handle this in AJAX. Would be nice to look into this but I'm unable ATM.

Selecting, settings, embeding now works again.