fix #21, a lot of refactoring, introduce automated build