Cleanup and add strrepl function

    * Cleanup extendedcommands.c
    * Move strrepl function to advanced_functions.c
    * Declare strrepl in advanced_functions.h