functions/generic cleaned up, indented, BOOST_FORCEINLINE where appropriate, copyright, headers