Add basic brain(mnesia) support, improve makefile and startup script