Phase transitions and self-organization in electronic and molecular networks