Made seraillpoll script into class for the Flask app to use.