What forms of government preceded democracy and how did this pave the way for the ancient Athenians to invent democracy?