Added function list_remove() which removes a node via given index.