fixed bit writing
started bitwriter tests
refactored file stuff out of bitIOStruct because readers and writers do different things