Shutdown spark context after tests. Formatting/minor fixes