Performance enhancements

Optimized the following parts of the OS:
- BMFS had a performance anti-pattern, which has been replaced, it looked like that:

    sub rax, 1
    cmp rax, 0
    jne some_label

- Memory allocation has been rewritten, while using exactly the same algorithm. Typical gain should be 3 cycles per call + 3 cycles per allotted block.