Slight improvements and optimizations; still working on it

Signed-off-by: Jack Huey kitskub@gmail.com
A couple quick performance improvements

many TODOs

Signed-off-by: Jack Huey kitskub@gmail.com