std.bitmanip BitArray refactor and various fixes