Way too much.

fixes #3, #18
implements #5, #10, #12, #13 
partially implements #4