Feature/space optimize

These are safe optimizations. All about inlining code, which may sound counter-intuitive, but it gives the compiler more chances to optimize over a larger body of code. Also small functions are good candidates, since the function call overhead in code size is greater than the function body when inlined.