General clean/tidyup of code and minor bugfixes

https://ci.nickpack.com/job/libpebble/ will probably explain the point better than I can word it :+1: