Updated tasks to use proper error messaging.

Also now tokenRegex is an option that allows changing the token syntax
in case of the default one is causing problems