Enabled 'include' and 'extends' to use paths relative to basedir

Replaces #788 with my review and changes and rebase.  This adds a `basedir` option at compile time that parallels the `filename` option to allow paths starting with `/` to be treated as relative to the `basedir` rather than the current file.

Will merge if no complaints by 2013-04-23T16:00:00Z