Fixing bug introduced by refactor to get HTML working again
more refactoring, ditching all those filthy globals in SpanParser.java
more tidying