My understanding of history here is very murky, and this is a glaring hole in my understanding of these pivotal times in Japanese history.
What little I have read seems to point to anti-shogunate forces having grievances against the bakufu's allowance of western influence (ie. Matthew Perry). Yet when the Imperialists take over, the next thing we hear about in the histories is the Meiji restoration - which modernized/westernized Japan at an unprecedented pace.
I feel like there's something I missed here. How did the imperialist forces protest westernization only to turn around and westernize even faster?
This is always difficult to explain to students because the politics is so convoluted during this period (1853-1877).
Best way I explain is this: Perry arrives. The shogunate understands that the West is strong and decides to open the country. The samurai who are not happy with this decision begin to complain and want to keep the country closed.
Two domains Satsuma and Choshu actually engage in combat with Western forces and learn quickly that the West is really powerful. (Choshu in particular makes a big turn around, and switches from wanting to keep the country closed to opening the country.)
These two domains then also begin to think that fundamental reform is necessary to keep Japan independent and that the centralized feudalism of the Tokugawa shogunate can't do the reforms fully. (Obviously the Tokugawa think otherwise and get Dutch and French help to modernize.)
So how do you rally the samurai to defeat the Tokugawa shogunate? Satsuma and Choshu decide to pay lip service to the anti-foreign sentiment and run with the slogan, Sonno Joi (Revere the Emperor, Expel the Barbarian). This is why many samurai mistakenly think Satsuma and Choshu want to expel the barbarians and maintain the traditions while the Tokugawa shogunate wants to open the country and do Westernizing reforms.
Tokugawa shogunate is toppled, Satsuma and Choshu take over.
Since Satsuma and Choshu's real plan was to transform Japan so that Japan will remain independent, they launch the Fukoku Kyohei program (Rich Country, Strong Military). Japan remains open, an even greater Westernization program is unleashed, and samurai privileges are ended.
Samurai who thought Satsuma and Choshu wanted to close the country feel betrayed. Unhappy Samurai launch rebellions in the 1870s (Saga no ran, Jinpuren, Hagi no ran, etc). Notice that all the rebellions take place in western Japan, among the domains that helped the Meiji Restoration.
This culminates in the 1877 Seinan senso (Satsuma rebellion). Unhappy samurai rally around the former leader of Satsuma domain to try to restore samurai privileges by force and ultimate are crushed by the new Meiji government's conscript army.
This military defeat then births the Liberty and Popular Rights movement (a political movement that advocates the opening of a parliament). People learned that force won't change things, public opinion will be the only way.
At the fall of the Tokugawa Shogunate with the Meiji coup, the Meiji obligarch was not anti-modernization.
It was during earlier years (I believe in the earlier parts of the decade) that the key Meiji actors the Satsuma and Choshu were against foreign influences, however they were always focused on "expelling the barbarians" (kicking out the foreigners and standing up to the British/Americans) rather than getting rid of foreign technology as a whole. Satsuma in particular was always interested in foreign technology.
But two factors were important, the first of which is that a lot of the conservative leaders of those two clans were killed in the first rounds of political struggle, second of all their anti-foreign tendencies made them the target of British attacks (i.e http://en.wikipedia.org/wiki/Bombardment_of_Kagoshima). This made the remaining leaders realize the importance of military modernization.
By this time both the Shogunate fell both the imperial and Shogunate forces has already agreed on modernization, it was fought over how to divide the spoils of modernization.