adding basic stats API and library functionality
adding remove-unused replacer