Add some core doc comments, remove dead code