Added rank_callback layer

@mortenvp please take a look and let me know what you think