added close method so it will play nice with Node-RED
Added unit tests, added isClosed and guards to prevent calling read/write methods once closed
Merge pull request #5 from hardillb/master

added close method so it will play nice with Node-RED