Build system improvements

Close issue #17.