Make the project work with Arduino >=1.0.1
Clean and format the code