Fix an issue where some error messages would not be returned
Extract GremlinScript core files to a distinct library