Optimization for build_profile function on microslabbed layers

I noticed more time was being spent multiplying and adding zeros in this function than on my numerical code. This appears to be a safe optimization, but I'd like your opinion on it. It speeds up large spline layers spectacularly.

I still don't understand why github shows all these other commits. This branch only really relates to commit 7dafe47.