Added AVR implementation & reorganised