Restructured for the very picky arduino library format and fixed bugs so I could compile the test sketch