Judge sees dark writings of Michigan school shooter who could get life in prison