Some work on showing/hiding actions based on the selected view (#150). Also some minor cleaning up.