Add some (buggy) context menu code. Needs to be cleaned up a bit, but it's a good place to start from.