Writing identity module in progress. Other minor changes.