added an api call and fixed a bunch of stuff

added lineStyle api
refactored internals a bit
should support unlimited drawing commands now