Create library.py

Main library to work with matrix.