For encoders,
A handful of teams (254/1538/973/1323 etc..) have just drilled a hole at the end of the shaft, shove an encoder in there, and zip tie the wiring down.
http://puu.sh/bSXmC/4694259cf2.jpg
I would atleast snap ring the sprocket side and use a bolt/washer on the other side. If you don't have the resources you could always just buy the VersaChassis hex shaft:
http://content.vexrobotics.com/vexpr...awing-Rev2.PDF