Rewrite string handling using reqular expressions
Correct volatility category on functions (from STABLE to IMMUTABLE)