Add substitution for STATEDIR and substitute vars with a default path