Switch to MySQL + constraints for domain classes + fixes