refactors sidebar close and fixes clusterclick logic resolves #7, #8

@cbeer Starts to address some of the refactoring that needs to be done. Resolves immediate issues #7 and #8