Add logging, debug options, basic class organization