I'm building a BB-8, need help with what's going inside.

Title says it all. I have very limited knowledge on how electronics actually work. I’ve got some history writing code, so I think that might be helpful, but I need to know what I actually need.

Here’s a picture of how i’m designing it:

http://i.imgur.com/PdctVyL.png

So i know i’ll need a IMU to keep the weight centered. The weight spins and is used to turn the ball left to right while the ball itself isn’t turning and also as a center of gravity. Have no idea what else I need after that besides a few planetary motors and such. Literally no idea. How do I attach the motor to the IMU and the IMU to the battery? Also, how do i make it so I can move the motor without the IMU correcting it?

I’d love some of your input! This isn’t the way most people have been making them, but i’m 95% sure this is the screen accurate way.

So… what’s a BB-8?