make native freebsd compatible again

add entry code
undefine freebsd putchar macro
move internal incldues around
substitute BSD for __FreeBSD__ macro
wop