some refactoring. more progress on css parsing and testing