Made a BaseActivity to avoid duplicate code

Created a BaseAcivity to have all the duplicate code from the
MouseActivities in one place.
Reformatted 'UI' package to 'ui'.