Added types, text mode functions, changed main

Main actually has a use now