Feature floor

From a discussion on the use-list it became apparent that the floor() and ceil() functions were missing, so I added them. They're easy enough to work around at a script level, so this isn't an urgent fix, but they were easy enough to add to the engine. In the process I noticed a lot of similarity in math functions, so I started the process of refactoring funcs.h etc to inherit from a common class.