add keystone module

this is an attempt to move all the keystone interaction into a central
place to prevent code duplication across the commands