Moved all bit I/O/manipulation functions into separate source file.