Split platform-dependant definition in different header files

- platforms/standard -> Arduino UNO / Duemillanove boards
- platforms/mega -> Mega board
Refactored and fixed logging 

- writing in file is now done just after the opening 
- file is closed immediately after writing