Refactored core to allow for pluggable message handlers
Regex bug fixed