Added more tests, fixed some bugs, implemented format style options