- major rewrite, many bugfixes, fixed several compiler warnings
- added serial state check (verifies if connection is still available)