A lot of implementation

I did a lot of the functions. They are not thouroughly tested or
commented, and I was having some linker issues. Definitely a buggy
commit. lo siento.