Remove dependency on num and bigarray