Modeling nucleation and insulating properties of oxide surfaces and ultrathin films