Added a str_split() function, refactored events. No more memory leaks.