Worked on writeStatement() and gen. maintenance

Worked through a large chunk of writeStatement() and did general
maintenance (null to None, adding types., etc.)